package com.zhen.interceptor.thread;

import com.zhen.interceptor.service.ThreadService;
import lombok.extern.slf4j.Slf4j;

import java.util.Map;

@Slf4j
public class MyApplyTask implements Runnable{
    private Map<String, Object> params;
    private ThreadService threadService;

    public MyApplyTask(Map<String, Object> params, ThreadService threadService) {
        this.params = params;
        this.threadService = threadService;
    }

    @Override
    public void run() {
        log.info("run方法开始执行。。。。");
        try {
            log.info("线程等待2000。。。。");
            Thread.sleep(2000L);
        } catch (InterruptedException e) {
            e.printStackTrace();
        }
        threadService.doApplyTask(params);
    }
}
